{% extends "personal_center/base.html" %}
{% load state_display %}
{% block page_link %}
    <link rel="stylesheet" type="text/css" href="../../static/finance/css/tooltip.css">
    <script type="text/javascript" src="../../static/public_file/js/ModalBox.js"></script>
{% endblock %}


{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }
        .add_background {
            background: #A9A9A9;
        }
        .li-class {
            list-style: none;
            margin-top: 2%;
            color: #0b0b0b;
            cursor: pointer;
            height: 30px;
            line-height: 30px;
        }

        tr {
            height: 35px;
        }

        th {
            text-align: center;
        }


        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }

        .tab_top {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
        }


        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

        .div_for_control {
            width: 110px;
            float: right;
            text-align: center;
            margin-right: 6px;
            height: 40px;
        }

        .button_for_control {
            width: 90px;
            height: 30px;
            border: 1px solid #99D3F5;
            background: #D0EEFF;
            border-radius: 4px;
            letter-spacing: 0;
            line-height: 30px;
            color: #089bab;
        }
        #page_one button:hover {
            color: red;
        }
        .a_tag_cla {
            display: block;
            /*超出隐藏*/
            overflow: hidden;
            /*禁止换行*/
            white-space: nowrap;
            /*超出用省略号代替*/
            text-overflow: ellipsis;height: 30px;line-height: 30px;padding-left: 1%;
        }
        .shade {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(36, 36, 36, 0.5);
            display: none;
            z-index: 10000;
        }
        #addForm1 {
            width: 800px;
            height: 620px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            z-index: 10100;
            font-size: 0;
        }
        #title {
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 10px;
            height: 50px;
            color: #0b0b0b;
            cursor: move;
            /*border: #dfdfdf solid 1px;*/
            width: 100%;background: #f4f7fa;border-top-left-radius: 5px;border-top-right-radius: 5px;
        }
        .search {
            width: 300px;
            display: flex;
            float: right;
            margin: 10px 0;
            margin-right: 1%;
            /*border: 1px solid red;*/
        }

        .search input {
            vertical-align: middle;
            float: left;
            flex: 4;
            height: 30px;
            width: 230px;
            outline: none;
            border: 1px solid #0070c1;
            box-sizing: border-box;
            border-bottom-left-radius: 3px;
            border-top-left-radius: 3px;
        }
        .search button {
            float: right;
            flex: 1;
            height: 30px;
            width: 70px;
            line-height: 30px;
            background-color: #0070c1;
            color: white;
            border-style: none;
            outline: none;
            border-bottom-right-radius: 3px;
            border-top-right-radius: 3px;
        }
        .search button i {
            font-style: normal;
        }
        .search button:hover {
            font-size: 16px;
        }
        .p_tag {
            float: right;
            position: absolute;
            bottom: 0;
            right: 0;padding-right: 2%;padding-bottom: 2%;
        }
    </style>
{% endblock %}

{% block right_content %}
    <div style="width: 100%;height: 40px;background: white;border-bottom: #A9A9A9 solid 0.5px;line-height: 40px;padding-left: 1%;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>
        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="lct_tag" class="tab_top" onclick="change_mind('lct')">
            流程图
        </div>

        <div id="" style="width: 100px;float: right;text-align: center;margin-right: 1%;height: 40px;">
            <button id="" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
                    style="width: 100px;height: 30px;line-height: 27px;border: #1E90FF solid 1px;background: #1E90FF;color: white;margin-top: 5px;border-radius: 3px;">
                操作
            </button>
        </div>

        <div id="do_back" style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;">
            <button onclick="javascript:history.back(-1)" id="print"
                    style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                返回
            </button>
        </div>

        {% if print_flag == 'true' %}
            <p class="p_tag">
                <img src="../../static/personal_center/img/26B下一个.png" class="tab_top" onclick="GetNext('below')" style="width: 30px;height: 30px;float: right;margin-right: 10px;margin-top: 5px;" alt="">
                <img src="../../static/personal_center/img/26A上一个.png" class="tab_top" onclick="GetNext('upper')" style="width: 30px;height: 30px;float: right;margin-right: 20px;margin-top: 5px;" alt="">
            </p>
        {% endif %}
    <!-- 操作按钮隐藏块 -->
        <div id="page_one" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
             style="z-index: 1000; position: absolute; width: 100px; height: auto;right: 0.9%; top: 80px;background: #FFFFFF; box-shadow: rgb(204 204 204) 2px 2px 10px;padding: 5px;display: none;">
            <button onclick="but_click()" id="print" style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 90px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                打印
            </button>
            {% if is_audit == 'true' or is_voucher == 'true' %}
                <button id="approve" onclick="online_tag()" class="button_for_control">
                    审批
                </button>
            {% endif %}

            {% if is_stop == 'true' %}
                <button id="is_stop" onclick="operate_button(this.id)" class="button_for_control">
                    终止
                </button>
            {% endif %}

            {% if is_shelve == 'true' %}
                <button id="is_shelve" onclick="reduction_func({{ obj.id }})" class="button_for_control">
                    还原
                </button>
            {% endif %}

            {% if is_edit == 'true' %}
                <button id="add_station" type="button" class="button_for_control" onclick="ExportCar()">
                    提交
                </button>
            {% endif %}
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 95%;background: white;overflow: auto;">
        <div id="menu_from" style="width: 100%;height: 100%;">
            <div style="width: 90%;margin-top: 20px;margin-left: 5%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;border: #cfcfcf solid 0.5px;text-align: center;height: 35px;line-height: 35px;">
                            <h3 id="form_name" style="text-align: center;">印章/重要证件使用(借用)审批单</h3>
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;">
                            申请详情
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人
                        </td>
                        <td id="ngr" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 0.5%;border-top: none;">{{ obj.apply_user.real_name }}</td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申请日期
                        </td>
                        <td id="gwwh" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;outline: none;border-top: none;">{{ obj.create_time | date:'Y-m-d H:i' }}</td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;事&nbsp;&nbsp;&nbsp;由
                        </td>
                        <td id="" style="width: 35%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;padding-left: 0.5%;" title="{{ obj.matter_type_text }}">
                            <div id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="{{ is_edit }}">{{ obj.matter_type_text }}</div>
                        </td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用印次数
                        </td>
                        <td id="" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;">
                            <input type="number" value="{{ obj.servings }}" readonly id="fenshu" style="width: 100%;height: 100%; border: none; outline: none"></td>
                    </tr>
                    {% if is_edit == 'true' %}
                        <tr style="width: 100%;">
                            {% if Quick == 'flase' %}
                                <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                    分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;导
                                </td>
                                <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="leader_charge">
                                    <select name="" id="leader_select" style="width: 100%;height: 100%;border: none;outline: none;">
                                        <option value="">请选择分管领导</option>
                                        {% for foo in leaders_obj %}
                                            <option value="{{ foo.id }}" {% if Bstep == foo.real_name %} selected {% endif %}>{{ foo.real_name }}</option>
                                        {% endfor %}
                                    </select>
                                </td>
                            {% else %}
                                <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                    分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;导
                                </td>
                                <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;{% if is_edit == 'true' %} width: 35%; {% else %} width: 85%; {% endif %}" {% if is_edit == 'false' %} colspan="3" {% endif %} id="leader_charge">
                                    <select name="" id="leader_select" style="width: 100%;height: 100%;border: none;outline: none;">
                                        <option value="">请选择分管领导</option>
                                        {% for foo in leaders_obj %}
                                            <option value="{{ foo.id }}" {% if Bstep == foo.real_name %} selected {% endif %}>{{ foo.real_name }}</option>
                                        {% endfor %}
                                    </select>
                                </td>
                                {% if is_edit == 'true' %}
                                    <td id="demo-1" style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                        <img src="../../static/finance/img/提示说明.png" style="width: 12px;height: 12px;" alt=""> 快速申请
                                    </td>
                                    <td style="width: 35%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;">
                                        <input type="radio" name="QuickApplication" value="yes" {% if obj.is_fast == 1 %} checked {% endif %}> 是
                                        <input type="radio" name="QuickApplication" value="no" style="margin-left: 15px;" {% if obj.is_fast == 0 %} checked {% endif %} > 否
                                    </td>
                                {% endif %}
                            {% endif %}
                        </tr>
                    {% endif %}
                    {% if obj.state == 'five' %}
                        <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                            用&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;编&nbsp;&nbsp;号
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="">
                            {{ obj.number }}
                        </td>
                    {% endif %}
                    <tr style="width: 100%;position: relative;">
                        {% if obj.credentials %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" title="{{ obj.seal_name }}" style="width: 35%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                            <td id="CertificateName" style="width: 15%;border: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;text-align: right;border-top: none;padding-right: 1%;">
                                证件名称
                            </td>
                            <td id="CertificateNameInput" style="width: 35%;height: 40px;border: #cfcfcf solid 0.5px;line-height: 35px;text-align: right;border-top: none;padding-left: 1%">
                                <input id="zjmc" type="text" style="width: 100%; height: 100%;border: none;" value="{{ obj.credentials }}" {% if is_edit == 'false' %} readonly {% endif %} >
                            </td>
                        {% else %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" colspan="3" title="{{ obj.seal_name }}" style="width: 85%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                        {% endif %}
                    </tr>
                    {% if quick_category %}
                        <tr id="shouquan_tr" style="width: 100%;">
                            <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;padding-right: 1%;">
                                授&nbsp;&nbsp;&nbsp;权&nbsp;&nbsp;&nbsp;类&nbsp;&nbsp;型
                            </td>
                            <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                {% if is_edit == 'true' %}
                                    {% for foo in category_json %}
                                        <p><input type="checkbox" class="shouquantype" value="{{ foo.id }}" {% if foo.flag == 'true' %} checked {% endif %}>{{ foo.category }}</p>
                                    {% endfor %}
                                {% else %}
                                    {{ quick_category }}
                                {% endif %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if obj.transfer == "1" %}
                        <tr style="width: 100%;">
                            {% if obj.types == 'a' %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    合同会签流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/finance/business_contract_detail_view?id={{ obj.countersign_id.id }}">{{ obj.countersign_id.contract_name }}</a>
                                </td>
                            {% else %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    行政公文流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/personal-center/document_approve.html?id={{ obj.conference_id.id }}">{{ obj.conference_id.conference_memo_text }}</a>
                                </td>
                            {% endif %}
                        </tr>
                    {% endif %}
                    <tr style="width: 100%;">
                        <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;padding-right: 1%;">
                            备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="note" contenteditable="{{ is_edit }}">{{ obj.note }}</td>
                    </tr>
                    {% if obj.state == 'four' or obj.state == 'eight' %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                抄&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送
                            </td>
                            <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3" onclick="fill_val('', '', 'travel')">
                                <input id="conferee" type="text" style="border: none;outline: none;width: 98%;height: 100%;" autocomplete="off">
                            </td>
                        </tr>
                    {% endif %}
                </table>

                {% if is_edit == 'true' %}
                    <!--附件-->
                    <table style="width: 100%;">
                        <thead>
                        <tr style="width: 100%;">
                            <td colspan="6" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;padding-right: 1%;border-top: none;">
                                上传附件
                                <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                                    上传文件
                                    <input type="file" name="party_main_body" id="party_main_body"
                                           onchange="upload_accessory('file1', 'party_main', 'party_main_body')">
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件名称
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件大小
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传时间
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传人员
                            </td>
                            <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                            </td>
                        </tr>
                        </thead>
                        <tbody style="overflow: auto;" id="party_main">
                        {% for record in main_file_list %}
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">{{ forloop.counter }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_name }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_size }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.upload_time }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.uploader }}</td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    <a target='_blank' href="{{ record.file_path }}">查看</a> | <a style="color: red;"
                                                                                                 href='#'
                                                                                                 onclick='RemoveTr(this, "party_main", {{ record.id }})'>删除</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% endif %}
            </div>

            <div style="width: 90%;margin-left: 5%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                            审批详情
                        </td>
                    </tr>
                    <!--科室负责人意见-->
                    {% if "C/D" in audit_dic %}
                        <tr id="fzrcs_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                科室负责人意见
                            </td>
                            <td id="fzrcs" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'C/D' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div id="fzrcs_op"
                                                     style="width: 100%;line-height: 20px;position: relative;">
                                                    <!--                                            {{ item.audit_user }}-->
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'B' in audit_dic %}
                        <tr id="fgld_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                分管领导意见
                            </td>
                            <td id="zhuren" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'B' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'ys' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                院&nbsp;&nbsp;长&nbsp;&nbsp;授&nbsp;&nbsp;权
                            </td>
                            <td colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'ys' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--办公室意见-->
                    {% if 'BGS' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td id="bangongshi" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'BGS' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'sjk' in audit_dic %}
                        <tr id="" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                审计科审核意见
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'sjk' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'stb' in audit_dic %}
                        <tr id="" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'stb' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--主任意见-->
                    {% if 'YB' in audit_dic %}
                        <tr id="ybzr_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                办公室主任意见
                            </td>
                            <td id="fenguan" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YB' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'YZ' in audit_dic %}
                        <tr id="yz_sc" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                书记/院长审核意见
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YZ' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'END' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'END' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'audits' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                审计科审核意见
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'audits' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'END_2' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'END_2' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}
                </table>
            </div>

            {% if copy_flag == 'ture' %}
                <div style="width: 90%;margin-left: 5%;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                                抄送详情
                            </td>
                        </tr>
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;border: #cccccc solid 0.5px;border-top: none;padding-left: 1%;">
                                <div style="width: 98%;position: relative;">
                                    {% for foo in copy_obj %}
                                        <div style="width: 100%; height: 80px; border-bottom: 1px solid rgb(204, 204, 204);">
                                            <div>
                                                <span>{% if foo.look_over == '1' %} 已查看 {% else %} 未查看 {% endif %}</span>
                                            </div>
                                            <div>
                                                {% if foo.look_over == '1' %}
                                                    {% if foo.recipient.signature_picture %}
                                                        <img style="width: 100px;height: 40px;" src="/media/{{ foo.recipient.signature_picture }}">
                                                    {% else %}
                                                        {{ foo.recipient.real_name }}
                                                    {% endif %}
                                                {% else %}
                                                    {{ foo.recipient.real_name }}
                                                {% endif %}
                                            </div>
                                            <div style="position: absolute; right: 0px; width: 300px; text-align: right; color: rgb(11, 11, 11); line-height: 0px;">
                                                {% if foo.look_over == '1' %}
                                                    {{ foo.update_time|date:'Y-m-d H:i' }}
                                                {% endif %}
                                            </div>
                                        </div>
                                    {% endfor %}
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            {% endif %}
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">
                {% for item in main_file_list %}
                    {% if item.file_type == '0' %}
                        <div><a href="#" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                    {% endif %}
                {% endfor %}
            </div>
            {% if flag == 'true' %}
                <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                    盖章文件
                </div>
                <div id="yt_zhengwen1" style="width: 100%;">
                    {% for item in main_file_list %}
                        {% if item.file_type == '1' %}
                            <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="lct" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 40%;text-align: center;margin: 20% auto;">
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    ({{ obj.apply_user.real_name }})<br>
                    发起人
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    start
                </div>
            </div>

            {% if 'C/D' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'C/D' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                科室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'B' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'B' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                分管领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'ys' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'ys' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                分管领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'BGS' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'BGS' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'sjk' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'sjk' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'stb' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'stb' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YB' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YB' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                院办主任
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YZ' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YZ' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                书记/院长
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'END' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'END' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'audits' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'audits' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'END_2' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'END_2' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <div style="display: inline-block;border: #0d8ddb solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    <span style="visibility: hidden;">({{ obj.apply_user.real_name }})</span><br>
                    结束
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    ending
                </div>
            </div>
        </div>
    </div>

    <div id="new_models" style="width: 100%;height: 100%;display: none;">
        <div style="width: 700px;height: 500px;background: #F5F5F5;z-index: 10100;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
            <div id="box" style="width: 100%;height: 50px;background: #f4f7fa;cursor: move;border-top-left-radius: 5px;border-top-right-radius: 5px;">
                <h5 id="modal-title" class="modal-title" style="line-height: 50px;margin-left: 1%;display: inline-block;">用印审批</h5>
                <span onclick="close_models()" style="float: right;line-height: 50px;padding-right: 2%;cursor: pointer;"><i class="iconfont icon-quchu"></i></span>
            </div>
            <hr>
            <div style="height: 400px;width: 100%;padding-top: 2%;">
                <div style="width: 100%;height: 30px;">
                    <div style="display: inline-block; width: 100%;padding-left: 2%;">
                        <input type="radio" name="approve" value="audit" onclick="select_button_1('audit', '{{ obj.state }}')" checked> 同&nbsp;&nbsp;&nbsp;意
                        <input style="margin-left: 3%;" type="radio" name="approve" value="draft" onclick="select_button_1('draft', '{{ obj.state }}')"> 不同意
                        {% if obj.state == 'four' or obj.state == 'three' or obj.state == 'ten' %}
                            <input style="margin-left: 3%;" type="radio" name="approve" value="referral" onclick="select_button_1('referral', '{{ obj.state }}')"> 转&nbsp;&nbsp;&nbsp;审
                            <div id="contral_tag" style="display: none;width: 40%;">
                                <div id="tag_one" style="margin-left: 10px;">
                                    <select name="" id="zs_person" style="margin-left: 10px;width: 200px;">
                                        {% for foo in user_obj %}
                                            <option value="{{ foo.id }}">{{ foo.real_name }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                            </div>
                        {% endif %}
                    </div>
                </div>
                <div style="margin-top: 2%;width: 100%;height: 350px;">
                    <div id="ApprovalOpinions" style="width: 100%;padding-left: 2%;{% if obj.state == 'four' or obj.state == 'eight' or obj.state == 'five' or obj.state == 'ten' %} height: 50%; {% else %} height: 100%; {% endif %}">
                        <label style="vertical-align: top;">意见</label>
                        <textarea name="" id="opinion_detail" style="width: 90%;outline: none;border: none;height: 90%;"></textarea>
                    </div>
                    <div id="attachment" style="width: 100%;height: 100%;{% if obj.state == 'four' or obj.state == 'eight' or obj.state == 'five' or obj.state == 'ten' and obj.voucher == '0' %} display: inline-block; {% else %} display: none; {% endif %}">
                        <div style="width: 100%;background-color: #F5F5F5;color: #1E90FF;border: #cccccc solid 1px;border-bottom: none;padding-right: 1%;height: 40px;">
                            <a href="javascript:;" class="file" style="vertical-align: top;float: right;margin-top: 5px;">
                                上传文件
                                <input type="file" name="party_main_body1" id="party_main_body1" onchange="upload_accessory('file2', 'party_main1', 'party_main_body1')">
                            </a>
                        </div>
                        <table style="width: 100%;">
                            <thead>
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    文件名称
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    文件大小
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    上传时间
                                </td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    上传人员
                                </td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                                </td>
                            </tr>
                            </thead>
                            <tbody style="overflow: auto;" id="party_main1">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <hr>
            <!--        审批提交按钮-->
            <div style="width: 100%;height: 50px;text-align: right;padding-right: 2%;">
                <button onclick="summit_data()"
                        style="width: 100px;height: 30px;border: #dfdfdf solid 1px;margin-top: 10px;border-radius: 3px;background: #1E90FF;color: white;">
                    提交
                </button>
            </div>
        </div>
    </div>

    <div id="addForm" class="shade">
        <div id="addForm1">
            <div id="title">
                <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 50px;font-size: 20px;">
                    <p style="margin-left: 1%;display: inline-block;font-size: 18px;">选择抄送人员</p>
                </div>

                <div class="search" style="vertical-align: center;display: inline-block;text-align: right;margin-left: 35%;font-size: 14px;">
                    <input type="text" placeholder="请输入..." name="" id="search_data" value="">
                    <button id="search_button">搜索</button>
                </div>
                <span onclick="close_models1()" style="float: right;line-height: 50px;padding-right: 2%;cursor: pointer;"><i class="iconfont icon-quchu"></i></span>
            </div>
            <hr>
            <div style="display: inline-block;width: 30%;height: 350px;border-right: #E8E8E8 solid 1px;">
                <div style="width: 100%;height: 35px;line-height: 35px;padding-left: 2%;color: #0b0b0b;border-bottom: #cfcfcf solid 1px;font-size: 14px;">
                    <div id="an_branch"
                         style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;color: #01aaed;">
                        按部门
                    </div>
                    <div id="an_rank"
                         style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;">按权限
                    </div>
                    <div id="an_func"
                         style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;">按职能
                    </div>
                </div>
                <div id="department_list" style="width: 100%;height: 315px;overflow: auto;">
                    <div style="width: 100%;height: 100%;text-align: center;">
                        <img style="width: 30%;height: 30%;margin-top: 35%;"
                             src="../../static/public_file/images/jiazai.gif" alt="">
                    </div>
                </div>
            </div>

            <div style="display: inline-block;width: 69.5%;height: 350px;overflow: auto;vertical-align: top;left: 0;font-size: 14px;">
                <table class="table table-hover table-bordered" style="border-collapse: collapse;margin: 0;padding: 0;width: 100%;">
                    <thead style="width: 100%;">
                        <tr style="width: 100%;">
                            <th scope="col" style="width: 10%;height: 30px;border: #dfdfdf solid 1px;">
                                <input id="all_select_checkbox" type="checkbox">
                            </th>
                            <th scope="col" style="width: 20%;height: 30px;border: #dfdfdf solid 1px;">序号</th>
                            <th scope="col" style="width: 35%;height: 30px;border: #dfdfdf solid 1px;">姓名</th>
                            <th scope="col" style="width: 35%;height: 30px;border: #dfdfdf solid 1px;">工号</th>
                        </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="t_table2"></tbody>
                </table>
                <div id="img-display1" style="width: 75%;text-align: center;">
                    <div style="margin-top: 10%;">
                        <img src="../../static/public_file/images/page-img/11.jpg" alt="">
                        <p style="margin: 0;padding: 0;vertical-align: top;">暂无数据</p>
                    </div>
                </div>
            </div>

            <div style="height: 150px;width: 100%;border-top: #E8E8E8 solid 1px;overflow: auto;">
                <div id="checked-label" style="margin-top: 1%;margin-left: 3%;width: 90%;font-size: 14px;">

                </div>
            </div>
            <hr>
            <div style="height: 70px;padding-right: 2%;font-size: 14px;">
                <button id="model-affirm" onclick="choose_people()" style="border-radius: 3px;height: 30px;float: right;margin-top: 15px;border: #1E90FF solid 1px;background: #1E90FF;color: white;">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提&nbsp;交&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </button>
            </div>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script src="../../static/system_setup/creat_from/js/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="../../static/finance/js/tooltip.js"></script>
    <script language="javascript" src="../../static/personal_center/js/jquery.jqprint-0.3.js"></script>
    <script>
        const uuid = "{{ uuid | safe }}"
        const state = "{{ obj.state }}"  // 该文件当前状态('one', '科室负责人审批'), ('two', '分管领导审批'), ('three', '办公室主任审批'), ('four', '办公室审批'), ('seven', '书记/院长审批'), ('five', '结束'), ('six', '拒绝'), ('cancel', '作废'), ('stop', '终止'), ('recall', '撤回')
        var initlist = [];
        department = "{{ department | safe }}";

        document.getElementById("sponsor").className = "add_class";
        document.getElementById("personage").className = "add-nav-active";
        var is_edit = "{{ is_edit }}"
        if (is_edit === "false") {
            $("#selectButton_1").css("pointer-events", "none");
            $("#selectButton").css("pointer-events", "none");
        } else {
            $("#fenshu").removeAttr("readonly")
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        function do_back() {
            window.location.href = document.referrer
        }

        function select_button(tag_tab) {
            if (tag_tab.value === 'true') {
                document.getElementById('tag_one').style.display = 'inline-block';
            } else {
                document.getElementById('tag_one').style.display = 'none';
            }
        }

        function select_button_1(tag_tab, state) {
            if (tag_tab === 'referral') {
                if (state === "four" || state === "ten") {
                    var zs_person = document.getElementById("zs_person");
                    var option = document.createElement("option");
                    option.innerText= "{{ dzb_obj.real_name }}";
                    option.value="{{ dzb_obj.id }}";
                    zs_person.appendChild(option)
                    if (state === "four") {
                        var option1 = document.createElement("option");
                        option1.innerText= "{{ sjk_obj.real_name }}";
                        option1.value="{{ sjk_obj.id }}";
                        zs_person.appendChild(option1)
                    }
                }
                document.getElementById('contral_tag').style.display = 'inline-block';
                document.getElementById("ApprovalOpinions").style.display='inline-block';
                document.getElementById("attachment").style.display='none';
            } else {
                document.getElementById('contral_tag').style.display = 'none';
                if (tag_tab === 'audit') {
                    if (state === 'four' || state === 'eight') {
                        {#document.getElementById("ApprovalOpinions").style.display='none';#}
                        document.getElementById("attachment").style.display='inline-block';
                    }
                }else {
                    document.getElementById("ApprovalOpinions").style.display='inline-block';
                    document.getElementById("attachment").style.display='none';
                }
            }
        }

        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            } else if (ele_id === "LH"){
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
                {#var main_file = {{ main_file_list|safe }};#}
                {#chage_yulan(main_file[0]['file_path'])#}
            }else {
                document.getElementById("lct").style.display = "inline-block";
                document.getElementById("lct_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            }
        }

        function online_tag() {
            document.getElementById("new_models").style.display = "table";
        }

        function close_models() {
            document.getElementById("new_models").style.display = "none";
        }

        function summit_data() {
            var present_id = window.location.href.split("id=")[1].replace("#", '');
            var approve = $("input[type=radio][name=approve]:checked").val();
            var audit_note = document.getElementById("opinion_detail").value;
            var data_str = '';var leader_id = ''
            if (approve === "draft") {
                if (!audit_note) {
                    alert("不同意请填写理由！");
                    return false
                }
            }
            if (approve === "referral") {
                leader_id = $("#zs_person").val();
            }

            var cs_people = ''
            var ObjState = "{{ obj.state }}";
            if (ObjState === 'four' || ObjState === 'eight') {
                cs_people = document.getElementById("conferee").value;
            }

            data_str = "id=" + present_id + "&state=" + String(approve) + "&audit_note=" + String(audit_note) + "&leader_id=" + leader_id + "&cs_people=" + cs_people

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personal-center/seal_apply_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send(data_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert(JsonDate["message"]);
                            window.location.href = '/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd='
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        //点击selectButton，展示多选框
        function myclick() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "block";
        }

        function myclick1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        function but_click() {
            $('#menu_from').jqprint({
                debug: false,
                importCSS: true,
                printContainer: true,
                operaSupport: false
            });
        }

        // 修改
        function ExportCar() {
            var url = window.location.href;
            var id = url.split('?id=')[1].replace("#",'');
            var fenshu = document.getElementById("fenshu").value;                   // 用印份数
            var yysy = document.getElementById("yysy").innerText;             // 用印事由
            var selectButton_1 = document.getElementById("selectButton_1").innerText;       // 印章名称
            var note = document.getElementById('note').innerText;                       // 备注
            var leader_select = document.getElementById("leader_select").value;
            if (!leader_select) {
                alert('请选择分管领导!')
                return false
            }
            var reg = RegExp(/其他证书/);
            var credentials = '';
            if (selectButton_1.match(reg)) {
                credentials = document.getElementById('zjmc').value;            // 证件名称
                if (!credentials) {
                    alert('选择其他类型时,必须填写证件名称!!!')
                    return false
                }
            }

            var QuickApplication = $("input[type=radio][name=QuickApplication]:checked").val();
             var shouquan = []
            if (QuickApplication === 'yes') {
                var shouquantype_list = document.getElementsByClassName("shouquantype");
                for (var sq=0; sq<shouquantype_list.length; sq++) {
                    if (shouquantype_list[sq].checked) {
                        shouquan.push(shouquantype_list[sq].value)
                    }
                }
                if (!shouquan.length){
                    alert('请上传授权类型！')
                    return false
                }
            }
            var data_str = "id="+String(id)+"&servings=" + fenshu + "&seal_name=" + selectButton_1 + "&credentials=" + credentials + "&matter_type_text=" + yysy + '&fj_number=' + String(uuid) + "&note=" + note+"&QuickApplication="+String(QuickApplication)+"&leader_select="+String(leader_select)+"&shouquan="+JSON.stringify(shouquan);

            if (!fenshu || fenshu === '0') {
                alert("请填写用印份数！");
                return false
            }
            if (!selectButton_1) {
                alert("用印类型不能为空！");
                return false
            }
            if (!yysy) {
                alert('请填写用印事由！');
                return false
            }
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personal-center/seal_apply_write_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            console.log(data_str)
            xhr.send(data_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert(JsonDate["message"])
                            window.location.href='/personal-center/seal_apply_list_view';
                        } else {
                            alert(JsonDate["message"])
                        }
                    }
                }
            };
        }

        //鼠标进入多选框的div【selectdiv】
        function mousein() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "none";
        }

        function mousein1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "none";
        }

        //checkbox的点击事件
        function mycheck1(obj) {
            // 判断印章名称里面有没有其他类型
            if (obj.value === '其他证书') {
                if (obj.checked) {
                    document.getElementById('NameOfSealInput').style.width='35%';
                    document.getElementById('NameOfSealInput').removeAttribute('colspan');
                    document.getElementById('CertificateName').style.display='table-cell';
                    document.getElementById('CertificateNameInput').style.display='table-cell'
                }else {
                    document.getElementById('CertificateName').style.display='none';
                    document.getElementById('CertificateNameInput').style.display='none'
                    document.getElementById('NameOfSealInput').style.width='90%';
                    document.getElementById('NameOfSealInput').setAttribute('colspan', '3');
                }
             }
            var checked_list = document.getElementsByClassName("check_anniu");
            var checked_value = []
            for (var t = 0; t < checked_list.length; t++) {
                if (checked_list[t].checked) {
                    checked_value.push(checked_list[t].value)
                }
            }
            document.getElementById("selectButton_1").innerText = checked_value.join(", ");
        }

        function page_zhanshi() {
            document.getElementById('page_one').style.display = 'inline-block';
        }

        function page_yincang() {
            document.getElementById('page_one').style.display = 'none';
        }

        function operate_button(ele_id) {
            var url = window.location.href;
            var id = url.split("id=")[1];
            console.log(ele_id)
            if (ele_id === 'is_stop') {
                var state = 'stop';     // 终止
                var word = '终止'
            } else if (ele_id === 'is_cancel') {
                state = 'cancel';       // 作废
                word = '作废'
            } else{
                state = 'recall'
                word = '撤回'
            }
            var r = confirm('是否'+word+'流程？')
            if (r == true) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/personal-center/seal_apply_revoke_view", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("state=" + state + "&id=" + '{{ obj.id }}')
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            alert(JsonDate['message'])
                            window.location.href="/personal-center/seal_apply_list_view";
                        }
                    }
                };
            }
        }
        var user_type = "{{ user_type | safe }}";
        var tool_text = "";
        if (user_type === '1'){
            tool_text = "<p style='color: red'>需上传：</p>1.职工工作证明<br>2.职工聘用证明 <br>3.职工收入证明 <br>4.职工离职协议 <br>5.就业协议书 <br>6.保险核定单 <br>7.退休办理相关文书 <br>8.工伤申报相关文书"
        }else if (user_type === '2') {
            tool_text = "<p style='color: red'>需上传：</p>1.大学生实习实训办理文书（申请表、鉴定表、延续申请表、考勤表） <br>2.学分审验表 <br>3.各级各类科研项目申报、科研项目合同书（任务书）、结题/验收申请相关文书 <br>4.各级各类继续医学教育项目申报、办班管理（会议通知、日程），会议反馈资料相关文书 <br>5.各级各类学会任职申请表 <br>6.省市级科普大赛报名表"
        }else if (user_type === '3') {
            tool_text = "<p style='color: red'>需上传：</p>1.京山市大学生实习实训鉴定表 <br>2.实习生考勤表 <br>3.选送进修同意书 <br>4.外出进修合同书 <br>5.外出学习、进修函"
        }else if (user_type === '4') {
            tool_text = "<p style='color: red'>需上传：</p>残疾人证申请表"
        }else if (user_type === '5') {
            tool_text = "<p style='color: red'>需上传：</p>1.荆门市基本医疗保险（生育）备案登记表 <br>2.职工婚育情况证明 <br>3.职工计划生育证明材料"
        }else {
            tool_text = ''
        }
        $(document).ready(function(){
            if (document.getElementById("demo-1")) {
                $('#demo-1').tooltip({text: tool_text,fontSize: '12px', theme: 'light', marginLeft: "0"});
            }
		});

        // 上传附件
        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', uuid)
            form.append('source', 'yysq')
            form.append('voucher', 'voucher')
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData, tbody_id) {
            var t_table = document.getElementById(tbody_id);
            var local_host = window.location.host;
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                    td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                    td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                    td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                    td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                    td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                    td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"][i]["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["pdf_path"][i]["id"] + "\")'>删除</a>";
                    td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                    tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                    t_table.appendChild(tr);
                }
                if (JsonData["pdf_path"].length > 1) {
                    document.getElementById("del_adjunct").style.display = 'block';
                }
            } else {
                tr = document.createElement("tr");td1 = document.createElement("td");td2 = document.createElement("td");td3 = document.createElement("td");td4 = document.createElement("td");td5 = document.createElement("td");td6 = document.createElement("td");
                td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["id"] + "\")'>删除</a>";
                td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                t_table.appendChild(tr);
            }
        }

        function RemoveTr(_this, tbody_id, wj_id) {
            var table = document.getElementById(tbody_id);
            var trNode = $(_this).parent().parent();
            trNode.remove();

            for (var i = 0; i < table.children.length; i++) {
                table.children[i].children[0].innerHTML = i + 1;
            }

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
            };
        }

        function reduction_func(ele_id) {
            var r = confirm('是否还原该流程？')
            if (r) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/system-setup/reduction", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("id=" + String(ele_id));
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            alert("还原成功！");
                            window.location.href='/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd=';
                        }
                    }
                };
            }
        }

        function GetNext(get_type) {
            var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/system-setup/get_next", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("id={{ obj.id }}&get_type=" + String(get_type));
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            if (JsonDate['code'] === 200) {
                                window.location.href='/personal-center/seal_apply_detail_view?id='+JsonDate['id'];
                            }else {
                                alert(JsonDate['message'])
                            }
                        }
                    }
                };
        }
    </script>
{% endblock %}
